import os
def getdirsize(files_):
    total = 0
    all_files = os.listdir(files_)
    for i in all_files:
        fullpath = os.path.join(files,i)
        if os.path.isfile(fullpath):
            print(fullpath,'文件')
            total += os.path.getsize(fullpath)
        elif os.path.isdir(fullpath):
            print(fullpath,'目录')
            total += getdirsize(fullpath)
        else:
            print(fullpath,'链接')
            total += os.path.getsize(fullpath)
    return total
